/*
 * AppID.h
 *
 *  Created on: 2018年10月24日
 *      Author: zhengboyuan
 */

#ifndef APPID_H_
#define APPID_H_

#include "BasicType.h"
#include <string>


class AppID
{
public:
    static size_t MAX_ID;

public:
    AppID(const char* prefix = "AppID");
    virtual ~AppID();

    void setPrefix(const std::string& prefix);

    size_t getID();

    std::string getName();

    void reset();

protected:
    bool makeID(size_t& id, std::string& name);

    void cleanup();

protected:
    size_t m_id;
    std::string m_name;
    std::string m_prefix;
    HANDLE  m_handle;

};

#endif /* APPID_H_ */
